        Kaleidagraph FFT Macro documentation

Written by Neil Singer, Convolve, Inc.
Copyright 1990 by Convolve, Inc. All rights reserved.


There are three sets of forward and inverse FFT programs. The choice of which to use depends on the field of use. The difference is in where a factor of 1/N is placed. (In order for x = iFFT(FFT(x)) a factor of 1/N must be included. Most mathematicians use the first definition in which the 1/N is placed in the inverse FFT. The cleaner version is to include a factor of 1/sqrt(N) in both the FFT and inverse FFT. The last version of the FFT, in which the 1/N factor multiplies the forward transform is used in random vibration theory (my field) and is therefore the best. The definitions are listed in order of popularity.

The input to the routines is the same. A time column must be first, followed by a column of real parts; followed by a column of imaginary parts. The imaginary part column is optional. The output is a frequency column; followed by a real part column; followed by an imaginary part column; followed by a magnitude column; followed by a phase column (in degrees).

Time is assumed to be in seconds and frequency is generated in hertz. Note that the time interval of the sampling is obtained from the last two time values in the time column. The inverse FFT assumes that the function starts at t=0. (you can offset this after the iFFT using the formula window.

The number of data points does not have to be a power of two, however, the routine zero pads the end of the function until it is a power of two - so be aware of this fact.

The input data is destroyed in taking the FFT (unless you do an undo macro) so you may want to save a copy first.

It takes about 30 seconds to take a 1024 point FFT of a complex function on a Mac IIci.



Good luck,
I warrantee nothing, but I hope you find it useful.


The data registers are used as follows:

Variable Name	Memory Location
N	0
MR	1
NN	2
M	3
L	4
TR	5
TI	6
ISTEP	7
EL	8
WR	9
WI	10
I	11
J	12
FI(J)	13
FI(I)	14
FR(J)	15
FR(I)	16
DT	17
1/(NDT)	18
SQRT(N)	97

End Routine Counters
Col 0 (Frequency)	99
Col 1 (Real Part)	96
Col 2 (Imag Part)	95
Col 3 (Magnitude)	94
Col 4 (Phase)	93

